using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using MercuryParticleEngine.Emitters;
using BumbleGame;

namespace MercuryParticleEngine.Modifiers
{
    public class RightPollenTrigger : Modifier
    {
        private bool _rightFoot;

        public RightPollenTrigger(bool triggerOnLeftFoot)
        {
            _rightFoot = triggerOnLeftFoot;
        }

        public override void UpdateEmitter(GameTime time, Emitter emitter)
        {
            //make the pollen scroll a little
            //float elapsed = (float)time.ElapsedGameTime.TotalSeconds;
            //emitter.Position.Y += elapsed * 60f;

            //trigger the pollen
            KeyboardState newState = Keyboard.GetState();

            if (_rightFoot)
            {
                if (newState.IsKeyDown(Keys.X))
                {
                    emitter.Trigger();
                }
            }
        }
    }
}